﻿using Sunny.UI;
using System;

namespace CentralVacuum.Keyboard
{
    public static class KeyboardClass
    {
        public static event Action<UITextBox> actionEvent;

        public static void OpenNumberBoard(UITextBox textbox)
        {
            NumberBoard numb = new NumberBoard
            {
                Style = Properties.Settings.Default.UIStyle
            };
            actionEvent += numb.SetValue;
            // 使用Action委托
            actionEvent?.Invoke(textbox);
            numb.ShowDialog();
            textbox.Parent.Focus();
        }
        public static void OpenStringBoard(UITextBox textbox)
        {
            StringBoard numb = new StringBoard
            {
                Style = Properties.Settings.Default.UIStyle
            };
            actionEvent += numb.SetValue;
            // 使用Action委托
            actionEvent?.Invoke(textbox);
            numb.ShowDialog();
            textbox.Parent.Focus();
        }
    }
}
